package cn.tedu.mvc;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("student")
public class StudentController1 {
    // get方式http://localhost:8080/student/save?id=666&name=jack&age=20
    //restful方式http://localhost:8080/student/save2/666/jack/20
    @RequestMapping("save")
    public String save(Integer id,String name,Integer age){
      return id+name+age;
    }
    @RequestMapping("save2/{id}/{name}/{age}")
    public String save2(@PathVariable Integer id,
                        @PathVariable String name,
                        @PathVariable Integer age){
        return id+name+age;
    }

}
